package com.sunny.wordstudy;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import com.sunny.dict.MDict;
import com.sunny.wordstudy.lib.Stat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ChooseDictView extends Activity
{
  Stat a = Stat.a();
  SharedPreferences b;
  ListView c;
  List d;
  final int e = 0;
  AdapterView.OnItemClickListener f = new f(this);

  private void a()
  {
    this.d = new ArrayList();
    new String();
    if (this.a.isLoadedDict())
    {
      HashMap localHashMap1 = new HashMap();
      localHashMap1.put("item", "dict.edb");
      localHashMap1.put("desc", getString(2131099660));
      localHashMap1.put("file", "dict.edb");
      localHashMap1.put("pic", Integer.valueOf(2130837507));
      this.d.add(localHashMap1);
    }
    int i = 0;
    if (i >= MDict.getDictCount())
    {
      label102: String[] arrayOfString2 = new String[3];
      arrayOfString2[0] = "pic";
      arrayOfString2[1] = "item";
      arrayOfString2[2] = "desc";
      int[] arrayOfInt = new int[3];
      arrayOfInt[0] = 2131230741;
      arrayOfInt[1] = 2131230742;
      arrayOfInt[2] = 2131230743;
      SimpleAdapter localSimpleAdapter = new SimpleAdapter(this, this.d, 2130903046, arrayOfString2, arrayOfInt);
      this.c.setAdapter(localSimpleAdapter);
      this.c.setOnItemClickListener(this.f);
      return;
    }
    HashMap localHashMap2 = new HashMap();
    String str1 = MDict.getDictFileName(i);
    String[] arrayOfString1 = str1.split("/");
    if (arrayOfString1.length > 0)
      str1 = arrayOfString1[(arrayOfString1.length - 1)];
    String str2 = MDict.getDictTitle(i);
    if (MDict.a(str2));
    for (String str3 = str1; ; str3 = str1 + " " + str2)
    {
      String str4 = MDict.getDictDesc(i).replaceAll("\\<br\\>", ". ").replaceAll("\\<.*?>", "").replaceAll("\\[.*?\\]", "").replaceAll("\\[.*?\\]", "").replaceAll("&.*?;", "");
      localHashMap2.put("item", str3);
      localHashMap2.put("desc", str4.trim());
      localHashMap2.put("file", str1);
      localHashMap2.put("pic", Integer.valueOf(2130837507));
      this.d.add(localHashMap2);
      ++i;
      break label102:
    }
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    a();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903041);
    this.b = PreferenceManager.getDefaultSharedPreferences(this);
    setTitle(getResources().getString(2131099760));
    this.c = ((ListView)findViewById(2131230723));
    a();
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    super.onCreateOptionsMenu(paramMenu);
    paramMenu.add(0, 0, 0, getResources().getString(2131099842));
    return true;
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    switch (paramMenuItem.getItemId())
    {
    default:
    case 0:
    }
    while (true)
    {
      return true;
      finish();
    }
  }
}

/* Location:           E:\Desktop\Android\wordstd\classes_dex2jar.jar
 * Qualified Name:     com.sunny.wordstudy.ChooseDictView
 * JD-Core Version:    0.5.3
 */